using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VBGBST
    {
        public DataRow Convert2BGBST(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryBGBST(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["BGMANDANT"] = " ".PadRight(2 ); 
         dwReturn["BGSA"] = " ".PadRight(2 ); 
         dwReturn["BGKART"] = " ".PadRight(20 ); 
         dwReturn["BGKVAR"] = " ".PadRight(2 ); 
         dwReturn["BGKFARBE"] = " ".PadRight(10 ); 
         dwReturn["BGZUSTAND"] = " ".PadRight(4 ); 
         dwReturn["BGZENSUR"] = " ".PadRight(1 ); 
         dwReturn["BGLO"] = " ".PadRight(2 ); 
         dwReturn["BGMJJ"] = " ".PadRight(4 ); 
         dwReturn["BGMM"] = " ".PadRight(2 ); 
         dwReturn["BGAKTKZ"] = " ".PadRight(1 ); 
         dwReturn["BGME01"] = " ".PadRight(0 ); 
         dwReturn["BGME10"] = " ".PadRight(0 ); 
         dwReturn["BGME11"] = " ".PadRight(0 ); 
         dwReturn["BGME12"] = " ".PadRight(0 ); 
         dwReturn["BGME13"] = " ".PadRight(0 ); 
         dwReturn["BGME14"] = " ".PadRight(0 ); 
         dwReturn["BGME20"] = " ".PadRight(0 ); 
         dwReturn["BGME21"] = " ".PadRight(0 ); 
         dwReturn["BGME31"] = " ".PadRight(0 ); 
         dwReturn["BGME32"] = " ".PadRight(0 ); 
         dwReturn["BGME33"] = " ".PadRight(0 ); 
         dwReturn["BGME34"] = " ".PadRight(0 ); 
         dwReturn["BGME35"] = " ".PadRight(0 ); 
         dwReturn["BGME36"] = " ".PadRight(0 ); 
         dwReturn["BGME37"] = " ".PadRight(0 ); 
         dwReturn["BGME40"] = " ".PadRight(0 ); 
         dwReturn["BGME41"] = " ".PadRight(0 ); 
         dwReturn["BGME42"] = " ".PadRight(0 ); 
         dwReturn["BGME43"] = " ".PadRight(0 ); 
         dwReturn["BGME46"] = " ".PadRight(0 ); 
         dwReturn["BGME47"] = " ".PadRight(0 ); 
         dwReturn["BGME48"] = " ".PadRight(0 ); 
         dwReturn["BGME49"] = " ".PadRight(0 ); 
         dwReturn["BGME50"] = " ".PadRight(0 ); 
         dwReturn["BGME51"] = " ".PadRight(0 ); 
         dwReturn["BGME52"] = " ".PadRight(0 ); 
         dwReturn["BGME53"] = " ".PadRight(0 ); 
         dwReturn["BGME55"] = " ".PadRight(0 ); 
         dwReturn["BGME73"] = " ".PadRight(0 ); 
         dwReturn["BGME76"] = " ".PadRight(0 ); 
         dwReturn["BGME79"] = " ".PadRight(0 ); 
         dwReturn["BGME80"] = " ".PadRight(0 ); 
         dwReturn["BGME88"] = " ".PadRight(0 ); 
         dwReturn["BGME89"] = " ".PadRight(0 ); 
         dwReturn["BGME90"] = " ".PadRight(0 ); 
         dwReturn["BGME91"] = " ".PadRight(0 ); 
         dwReturn["BGMEZUTEI"] = " ".PadRight(0 ); 
         dwReturn["BGRESV2"] = " ".PadRight(0 ); 
         dwReturn["BGRESV3"] = " ".PadRight(0 ); 
         dwReturn["BGRESV4"] = " ".PadRight(0 ); 
         dwReturn["BGRESV5"] = " ".PadRight(0 ); 
         dwReturn["BGBSTA"] = " ".PadRight(0 ); 
         dwReturn["BGBSTAN"] = " ".PadRight(0 ); 
         dwReturn["BGME24"] = " ".PadRight(0 ); 
         dwReturn["BGBSTKMA"] = " ".PadRight(0 ); 
         dwReturn["BGBSTKME"] = " ".PadRight(0 ); 
         dwReturn["BGBSTMA"] = " ".PadRight(0 ); 
         dwReturn["BGBSTME"] = " ".PadRight(0 ); 
         dwReturn["BGBSTVMA"] = " ".PadRight(0 ); 
         dwReturn["BGBSTVME"] = " ".PadRight(0 ); 
         dwReturn["BGMEIV"] = " ".PadRight(0 ); 
         dwReturn["BGINDAT"] = " ".PadRight(0 ); 
         dwReturn["BGINBST"] = " ".PadRight(0 ); 
         dwReturn["BGINALT"] = " ".PadRight(0 ); 
         dwReturn["BGEKPRMA"] = " ".PadRight(0 ); 
         dwReturn["BGEKPRME"] = " ".PadRight(0 ); 
         dwReturn["BGEKPRZU"] = " ".PadRight(0 ); 
         dwReturn["BGVRPR"] = " ".PadRight(0 ); 
         dwReturn["BGDLABST"] = " ".PadRight(0 ); 
         dwReturn["BGDLATAG"] = " ".PadRight(2 ); 
         dwReturn["BGMINBST"] = " ".PadRight(0 ); 
         dwReturn["BGMAXBST"] = " ".PadRight(0 ); 
         dwReturn["BGFERTKZ"] = " ".PadRight(1 ); 
         dwReturn["BGUEBER"] = " ".PadRight(1 ); 
         dwReturn["BGFILLER1"] = " ".PadRight(46 ); 
         dwReturn["BGAENDZL"] = " ".PadRight(0 ); 
         dwReturn["BGAENDBEN"] = " ".PadRight(8 ); 
         dwReturn["BGAENDDAT"] = " ".PadRight(0 ); 
         dwReturn["BGNEUBEN"] = " ".PadRight(8 ); 
         dwReturn["BGNEUDAT"] = " ".PadRight(0 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapBGBST(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveBGBST(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryBGBST(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapBGBST(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertBGBST(dwLocal, ITXDBVERSION);
            }
            UpdateBGBST(dwLocal);
        }
        public void InsertBGBST(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO BGBST(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryBGBST(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM BGBST WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM BGBST  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "BGBST";
            Return = Result;
            return Return;
        }
        public void DeleteBGBST(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM BGBST   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateBGBST(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE BGBST SET "
                    +"BGMANDANT= :BGMANDANT,"
                    +"BGSA= :BGSA,"
                    +"BGKART= :BGKART,"
                    +"BGKVAR= :BGKVAR,"
                    +"BGKFARBE= :BGKFARBE,"
                    +"BGZUSTAND= :BGZUSTAND,"
                    +"BGZENSUR= :BGZENSUR,"
                    +"BGLO= :BGLO,"
                    +"BGMJJ= :BGMJJ,"
                    +"BGMM= :BGMM,"
                    +"BGAKTKZ= :BGAKTKZ,"
                    +"BGME01= :BGME01,"
                    +"BGME10= :BGME10,"
                    +"BGME11= :BGME11,"
                    +"BGME12= :BGME12,"
                    +"BGME13= :BGME13,"
                    +"BGME14= :BGME14,"
                    +"BGME20= :BGME20,"
                    +"BGME21= :BGME21,"
                    +"BGME31= :BGME31,"
                    +"BGME32= :BGME32,"
                    +"BGME33= :BGME33,"
                    +"BGME34= :BGME34,"
                    +"BGME35= :BGME35,"
                    +"BGME36= :BGME36,"
                    +"BGME37= :BGME37,"
                    +"BGME40= :BGME40,"
                    +"BGME41= :BGME41,"
                    +"BGME42= :BGME42,"
                    +"BGME43= :BGME43,"
                    +"BGME46= :BGME46,"
                    +"BGME47= :BGME47,"
                    +"BGME48= :BGME48,"
                    +"BGME49= :BGME49,"
                    +"BGME50= :BGME50,"
                    +"BGME51= :BGME51,"
                    +"BGME52= :BGME52,"
                    +"BGME53= :BGME53,"
                    +"BGME55= :BGME55,"
                    +"BGME73= :BGME73,"
                    +"BGME76= :BGME76,"
                    +"BGME79= :BGME79,"
                    +"BGME80= :BGME80,"
                    +"BGME88= :BGME88,"
                    +"BGME89= :BGME89,"
                    +"BGME90= :BGME90,"
                    +"BGME91= :BGME91,"
                    +"BGMEZUTEI= :BGMEZUTEI,"
                    +"BGRESV2= :BGRESV2,"
                    +"BGRESV3= :BGRESV3,"
                    +"BGRESV4= :BGRESV4,"
                    +"BGRESV5= :BGRESV5,"
                    +"BGBSTA= :BGBSTA,"
                    +"BGBSTAN= :BGBSTAN,"
                    +"BGME24= :BGME24,"
                    +"BGBSTKMA= :BGBSTKMA,"
                    +"BGBSTKME= :BGBSTKME,"
                    +"BGBSTMA= :BGBSTMA,"
                    +"BGBSTME= :BGBSTME,"
                    +"BGBSTVMA= :BGBSTVMA,"
                    +"BGBSTVME= :BGBSTVME,"
                    +"BGMEIV= :BGMEIV,"
                    +"BGINDAT= :BGINDAT,"
                    +"BGINBST= :BGINBST,"
                    +"BGINALT= :BGINALT,"
                    +"BGEKPRMA= :BGEKPRMA,"
                    +"BGEKPRME= :BGEKPRME,"
                    +"BGEKPRZU= :BGEKPRZU,"
                    +"BGVRPR= :BGVRPR,"
                    +"BGDLABST= :BGDLABST,"
                    +"BGDLATAG= :BGDLATAG,"
                    +"BGMINBST= :BGMINBST,"
                    +"BGMAXBST= :BGMAXBST,"
                    +"BGFERTKZ= :BGFERTKZ,"
                    +"BGUEBER= :BGUEBER,"
                    +"BGFILLER1= :BGFILLER1,"
                    +"BGAENDZL= :BGAENDZL,"
                    +"BGAENDBEN= :BGAENDBEN,"
                    +"BGAENDDAT= :BGAENDDAT,"
                    +"BGNEUBEN= :BGNEUBEN,"
                    +"BGNEUDAT= :BGNEUDAT,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("BGMANDANT", OracleType.NVarChar).Value = dwData["BGMANDANT"].ToString(); 
          or1.Parameters.Add("BGSA", OracleType.NVarChar).Value = dwData["BGSA"].ToString(); 
          or1.Parameters.Add("BGKART", OracleType.NVarChar).Value = dwData["BGKART"].ToString(); 
          or1.Parameters.Add("BGKVAR", OracleType.NVarChar).Value = dwData["BGKVAR"].ToString(); 
          or1.Parameters.Add("BGKFARBE", OracleType.NVarChar).Value = dwData["BGKFARBE"].ToString(); 
          or1.Parameters.Add("BGZUSTAND", OracleType.NVarChar).Value = dwData["BGZUSTAND"].ToString(); 
          or1.Parameters.Add("BGZENSUR", OracleType.NVarChar).Value = dwData["BGZENSUR"].ToString(); 
          or1.Parameters.Add("BGLO", OracleType.NVarChar).Value = dwData["BGLO"].ToString(); 
          or1.Parameters.Add("BGMJJ", OracleType.NVarChar).Value = dwData["BGMJJ"].ToString(); 
          or1.Parameters.Add("BGMM", OracleType.NVarChar).Value = dwData["BGMM"].ToString(); 
          or1.Parameters.Add("BGAKTKZ", OracleType.NVarChar).Value = dwData["BGAKTKZ"].ToString(); 
          or1.Parameters.Add("BGME01", OracleType.NVarChar).Value = dwData["BGME01"].ToString(); 
          or1.Parameters.Add("BGME10", OracleType.NVarChar).Value = dwData["BGME10"].ToString(); 
          or1.Parameters.Add("BGME11", OracleType.NVarChar).Value = dwData["BGME11"].ToString(); 
          or1.Parameters.Add("BGME12", OracleType.NVarChar).Value = dwData["BGME12"].ToString(); 
          or1.Parameters.Add("BGME13", OracleType.NVarChar).Value = dwData["BGME13"].ToString(); 
          or1.Parameters.Add("BGME14", OracleType.NVarChar).Value = dwData["BGME14"].ToString(); 
          or1.Parameters.Add("BGME20", OracleType.NVarChar).Value = dwData["BGME20"].ToString(); 
          or1.Parameters.Add("BGME21", OracleType.NVarChar).Value = dwData["BGME21"].ToString(); 
          or1.Parameters.Add("BGME31", OracleType.NVarChar).Value = dwData["BGME31"].ToString(); 
          or1.Parameters.Add("BGME32", OracleType.NVarChar).Value = dwData["BGME32"].ToString(); 
          or1.Parameters.Add("BGME33", OracleType.NVarChar).Value = dwData["BGME33"].ToString(); 
          or1.Parameters.Add("BGME34", OracleType.NVarChar).Value = dwData["BGME34"].ToString(); 
          or1.Parameters.Add("BGME35", OracleType.NVarChar).Value = dwData["BGME35"].ToString(); 
          or1.Parameters.Add("BGME36", OracleType.NVarChar).Value = dwData["BGME36"].ToString(); 
          or1.Parameters.Add("BGME37", OracleType.NVarChar).Value = dwData["BGME37"].ToString(); 
          or1.Parameters.Add("BGME40", OracleType.NVarChar).Value = dwData["BGME40"].ToString(); 
          or1.Parameters.Add("BGME41", OracleType.NVarChar).Value = dwData["BGME41"].ToString(); 
          or1.Parameters.Add("BGME42", OracleType.NVarChar).Value = dwData["BGME42"].ToString(); 
          or1.Parameters.Add("BGME43", OracleType.NVarChar).Value = dwData["BGME43"].ToString(); 
          or1.Parameters.Add("BGME46", OracleType.NVarChar).Value = dwData["BGME46"].ToString(); 
          or1.Parameters.Add("BGME47", OracleType.NVarChar).Value = dwData["BGME47"].ToString(); 
          or1.Parameters.Add("BGME48", OracleType.NVarChar).Value = dwData["BGME48"].ToString(); 
          or1.Parameters.Add("BGME49", OracleType.NVarChar).Value = dwData["BGME49"].ToString(); 
          or1.Parameters.Add("BGME50", OracleType.NVarChar).Value = dwData["BGME50"].ToString(); 
          or1.Parameters.Add("BGME51", OracleType.NVarChar).Value = dwData["BGME51"].ToString(); 
          or1.Parameters.Add("BGME52", OracleType.NVarChar).Value = dwData["BGME52"].ToString(); 
          or1.Parameters.Add("BGME53", OracleType.NVarChar).Value = dwData["BGME53"].ToString(); 
          or1.Parameters.Add("BGME55", OracleType.NVarChar).Value = dwData["BGME55"].ToString(); 
          or1.Parameters.Add("BGME73", OracleType.NVarChar).Value = dwData["BGME73"].ToString(); 
          or1.Parameters.Add("BGME76", OracleType.NVarChar).Value = dwData["BGME76"].ToString(); 
          or1.Parameters.Add("BGME79", OracleType.NVarChar).Value = dwData["BGME79"].ToString(); 
          or1.Parameters.Add("BGME80", OracleType.NVarChar).Value = dwData["BGME80"].ToString(); 
          or1.Parameters.Add("BGME88", OracleType.NVarChar).Value = dwData["BGME88"].ToString(); 
          or1.Parameters.Add("BGME89", OracleType.NVarChar).Value = dwData["BGME89"].ToString(); 
          or1.Parameters.Add("BGME90", OracleType.NVarChar).Value = dwData["BGME90"].ToString(); 
          or1.Parameters.Add("BGME91", OracleType.NVarChar).Value = dwData["BGME91"].ToString(); 
          or1.Parameters.Add("BGMEZUTEI", OracleType.NVarChar).Value = dwData["BGMEZUTEI"].ToString(); 
          or1.Parameters.Add("BGRESV2", OracleType.NVarChar).Value = dwData["BGRESV2"].ToString(); 
          or1.Parameters.Add("BGRESV3", OracleType.NVarChar).Value = dwData["BGRESV3"].ToString(); 
          or1.Parameters.Add("BGRESV4", OracleType.NVarChar).Value = dwData["BGRESV4"].ToString(); 
          or1.Parameters.Add("BGRESV5", OracleType.NVarChar).Value = dwData["BGRESV5"].ToString(); 
          or1.Parameters.Add("BGBSTA", OracleType.NVarChar).Value = dwData["BGBSTA"].ToString(); 
          or1.Parameters.Add("BGBSTAN", OracleType.NVarChar).Value = dwData["BGBSTAN"].ToString(); 
          or1.Parameters.Add("BGME24", OracleType.NVarChar).Value = dwData["BGME24"].ToString(); 
          or1.Parameters.Add("BGBSTKMA", OracleType.NVarChar).Value = dwData["BGBSTKMA"].ToString(); 
          or1.Parameters.Add("BGBSTKME", OracleType.NVarChar).Value = dwData["BGBSTKME"].ToString(); 
          or1.Parameters.Add("BGBSTMA", OracleType.NVarChar).Value = dwData["BGBSTMA"].ToString(); 
          or1.Parameters.Add("BGBSTME", OracleType.NVarChar).Value = dwData["BGBSTME"].ToString(); 
          or1.Parameters.Add("BGBSTVMA", OracleType.NVarChar).Value = dwData["BGBSTVMA"].ToString(); 
          or1.Parameters.Add("BGBSTVME", OracleType.NVarChar).Value = dwData["BGBSTVME"].ToString(); 
          or1.Parameters.Add("BGMEIV", OracleType.NVarChar).Value = dwData["BGMEIV"].ToString(); 
          or1.Parameters.Add("BGINDAT", OracleType.NVarChar).Value = dwData["BGINDAT"].ToString(); 
          or1.Parameters.Add("BGINBST", OracleType.NVarChar).Value = dwData["BGINBST"].ToString(); 
          or1.Parameters.Add("BGINALT", OracleType.NVarChar).Value = dwData["BGINALT"].ToString(); 
          or1.Parameters.Add("BGEKPRMA", OracleType.NVarChar).Value = dwData["BGEKPRMA"].ToString(); 
          or1.Parameters.Add("BGEKPRME", OracleType.NVarChar).Value = dwData["BGEKPRME"].ToString(); 
          or1.Parameters.Add("BGEKPRZU", OracleType.NVarChar).Value = dwData["BGEKPRZU"].ToString(); 
          or1.Parameters.Add("BGVRPR", OracleType.NVarChar).Value = dwData["BGVRPR"].ToString(); 
          or1.Parameters.Add("BGDLABST", OracleType.NVarChar).Value = dwData["BGDLABST"].ToString(); 
          or1.Parameters.Add("BGDLATAG", OracleType.NVarChar).Value = dwData["BGDLATAG"].ToString(); 
          or1.Parameters.Add("BGMINBST", OracleType.NVarChar).Value = dwData["BGMINBST"].ToString(); 
          or1.Parameters.Add("BGMAXBST", OracleType.NVarChar).Value = dwData["BGMAXBST"].ToString(); 
          or1.Parameters.Add("BGFERTKZ", OracleType.NVarChar).Value = dwData["BGFERTKZ"].ToString(); 
          or1.Parameters.Add("BGUEBER", OracleType.NVarChar).Value = dwData["BGUEBER"].ToString(); 
          or1.Parameters.Add("BGFILLER1", OracleType.NVarChar).Value = dwData["BGFILLER1"].ToString(); 
          or1.Parameters.Add("BGAENDZL", OracleType.NVarChar).Value = dwData["BGAENDZL"].ToString(); 
          or1.Parameters.Add("BGAENDBEN", OracleType.NVarChar).Value = dwData["BGAENDBEN"].ToString(); 
          or1.Parameters.Add("BGAENDDAT", OracleType.NVarChar).Value = dwData["BGAENDDAT"].ToString(); 
          or1.Parameters.Add("BGNEUBEN", OracleType.NVarChar).Value = dwData["BGNEUBEN"].ToString(); 
          or1.Parameters.Add("BGNEUDAT", OracleType.NVarChar).Value = dwData["BGNEUDAT"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
